import NProgress from 'nprogress';
import "nprogress/nprogress.css";

export function install({router}) {
  router.beforeEach((to, from) => {
    if (to.path !== from.path) {
      if (to.meta?.progress !== false) {
        NProgress.start();
      }
    }
  });
  router.afterEach(() => {
    NProgress.done();
  });
}
